package svc

import (
	{{.configImport}}
	"google.golang.org/grpc/status"
)

type ServiceContext struct {
	Config {{.config}}
	{{.middleware}}
}

func NewServiceContext(c {{.config}}) *ServiceContext {
	return &ServiceContext{
		Config: c, 
		{{.middlewareAssignment}}
	}
}


type ErrResponse struct {
	Code string
	Message string
}

func (r ErrResponse) Error() string {
	return r.Message
}

func FromError(err error) (resp *ErrResponse,ok bool) {
	if r,ok:=  err.(ErrResponse);ok {
		return &r,ok
	}else if status.{
		return nil,false
	}
}

